package com.hjq.mallproduct.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @auther HJQ
 */
@Configuration
public class MyRedissonConfig {
    @Bean(destroyMethod = "shutdown")
    public RedissonClient redissonClient(){
        Config  config=new Config();
        config.useSingleServer().setAddress("redis://192.168.182.129:6379");//创建配置4
        //根据config对象创建实例
        return Redisson.create(config);
    }
}
